package com.qf.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.entity.Doctorconsultations;
import com.qf.entity.Doctororders;
import com.qf.service.doctororders.DoctorordersService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.qf.util.R;

import java.util.List;

/**
 * (Doctororders)表控制层
 *
 * @author makejava
 * @since 2024-12-06 20:25:56
 */
@RestController
@RequestMapping("/doctororders")
public class DoctorordersController {
    /**
     * 服务对象
     */
    @Autowired
    private DoctorordersService doctorordersService;

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @GetMapping("/list/page")
    public R queryByPage(Doctororders doctororders) {
        PageHelper.startPage(doctororders.getPageNum(), doctororders.getPageSize());

        List<Doctororders> list = doctorordersService.list(doctororders);

        PageInfo<Doctororders> pageInfo = new PageInfo<>(list);

        return R.ok(pageInfo);
    }
}

